package com.yanqu.road.server.cmd.activity.bulletscreen;

import com.yanqu.road.pb.activity.BulletScreenProto;
import com.yanqu.road.server.cmd.CrossCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.manager.activity.bulletscreen.CrossActivityBulletScreenMgr;
import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.server.protocol.Protocol;

@Cmd(code = Protocol.C_CROSS_ACTIVITY_LIST_BULLET_SCREEN_COMMENTS, desc = "弹幕列表")
public class CrossBulletScreenContentListCmd extends CrossCommand {

    int activityId;
    long readContentId;
    long lastReadTime;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        BulletScreenProto.CrossBulletScreenContentListReqMsg reqMsg = BulletScreenProto.CrossBulletScreenContentListReqMsg.parseFrom(packet.getBytes());
        activityId = reqMsg.getActivityId();
        readContentId = reqMsg.getReadContentId();
        lastReadTime = reqMsg.getLastReadTime();
        return true;
    }

    @Override
    public void execute(YanQuMessage packet) throws Exception {
        CrossActivityBulletScreenMgr.getMessageList(activityId, readContentId, serverId, packet.getPlayerId(), lastReadTime);
    }

    @Override
    public void sendData() {

    }
}
